package edu.sctu.zhuyingzhi.month201506.day20150626.observerMode;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user13 on 2015/6/26.
 */
public class Transporter implements Watched{
    List<Watcher> list = new ArrayList<>();
    @Override
    public void addWatch(Watcher watcher) {
        list.add(watcher);
    }

    @Override
    public void removeWatch(Watcher watcher) {
        list.remove(watcher);
    }

    @Override
    public void notifyWatcher() {
        for (Watcher watcher1 : list){
            watcher1.update();
        }
    }


}
